package com.hlkj.cartweb.feign;

import com.hlkj.pojo.common.TbBrand;
import com.hlkj.pojo.entity.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component
@FeignClient(value = "cart-service")//向哪个服务发送请求，做负载均衡
public interface TbBrandClient {
    @RequestMapping(value = "/getAllBrands")
    String findAllBrands();

    @RequestMapping(value = "/addBrand")
    String addBrand(@RequestBody TbBrand brand);

    @RequestMapping(value = "/updateBrand")
    String updateBrand(@RequestBody TbBrand brand);

    @RequestMapping(value = "/findById")
    String findById(@RequestParam Long id);

    @RequestMapping(value = "/deleteByIds", method = RequestMethod.POST)
    String deleteByIds(@RequestParam Long[] ids);

    @RequestMapping(value = "/findPage")
    String findPage(@RequestParam int page, @RequestParam int rows);

    @RequestMapping(value = "/search",method = RequestMethod.POST)
    String findPage(@RequestBody TbBrand brand, @RequestParam int page, @RequestParam int rows);
}
